package com.xmut.mall.coupon.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmut.mall.coupon.entity.CouponEntity;
import com.xmut.mall.coupon.searchparams.BuyerCouponSearchParam;
import com.xmut.mall.coupon.searchparams.ManagerCouponSearchParam;
import com.xmut.mall.coupon.searchparams.SellerCouponSearchParam;
import com.xmut.mall.coupon.vo.ManagerCouponPageVo;
import com.xmut.mall.coupon.vo.SellerCouponPageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

@Mapper
public interface CouponDao extends BaseMapper<CouponEntity> {

    /**
     * 获取卖家端优惠券的分页数据
     * @param initPage
     * @param param
     * @param date
     * @return
     */
    IPage<SellerCouponPageVo> getSellerCouponPage(Page<Object> initPage,@Param("param") SellerCouponSearchParam param,@Param("now") Date date);

    /**
     * 获取商城管理端的优惠券分页数据 获取平台券
     * @param initPage
     * @param param
     * @param date
     * @return
     */
    IPage<ManagerCouponPageVo> getManagerCouponPage(Page<Object> initPage,@Param("param") ManagerCouponSearchParam param,@Param("now") Date date);

    /**
     * 获取买家端的优惠券分页数据
     * @param initPage
     * @param param
     * @param date
     * @return
     */
    IPage<CouponEntity> getBuyerCouponPage(Page<Object> initPage, @Param("param") BuyerCouponSearchParam param,@Param("now") Date date);
}
